package com.todo.strategy.online.infrastructure.mapper;

import com.todo.strategy.online.infrastructure.entity.condition.PlanSetCondition;
import com.todo.strategy.online.infrastructure.entity.po.PlanSetPO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * (PlanSet)表数据库访问层
 *
 * @author zhangwenxiang
 * @since 2024-03-04 00:19:47
 */
public interface PlanSetMapper {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    PlanSetPO queryPlanSetPOById(Long id);

    /**
     * 新增数据
     *
     * @param planSet 实例对象
     * @return 影响行数
     */
    int insertPlanSetPO(PlanSetPO planSet);

    /**
     * 批量新增数据
     *
     * @param entities List<PlanSet> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<PlanSetPO> entities);

    /**
     * 修改数据
     *
     * @param planSet 实例对象
     * @return 影响行数
     */
    int updatePlanSetPOById(PlanSetPO planSet);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 影响行数
     */
    int removePlanSetPOById(Long id);

    /**
     * 多条件查询计划清单集合
     *
     * @param planSetCondition
     * @return
     */
    List<PlanSetPO> queryPlanSetByCondition(PlanSetCondition planSetCondition);

    /**
     * 多条件查询计划清单集合数量
     *
     * @param planSetCondition
     * @return
     */
    Long queryCountByCondition(PlanSetCondition planSetCondition);

    PlanSetPO queryPlanSetByUserAndTitle(@Param("userId") Long userId, @Param("title") String title);

    List<PlanSetPO> queryPlanSetPOByUserId(Long userId);

    Boolean removePlanSetByIdList(@Param("userId") Long userId, @Param("planIdList") List<String> planIdList);

    List<PlanSetPO> queryPlanSetListByTime(@Param("userId") Long userId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<PlanSetPO> queryPlanSetByIdList(@Param("planIdList") List<Long> planIdList);
}

